<template>
  <div class="main">
      <div class="tree-menu">
    <ul v-for="menuItem in theModel">
       <my-tree :model="menuItem"></my-tree>
    </ul>
  </div>

  </div>

</template>

<script>
  import myTree from './treemenu'
  import {companyList} from '@/api/api'
 import { XHeader, Tabbar, TabbarItem, Group, Cell } from 'vux'
export default {
  name: 'App',
  data () {
      return {
        theModel: []
      }
 },
  components: {
    Tabbar,
    TabbarItem,
    Group,
    Cell,
    XHeader,
     myTree
  },
  created () {
    this.getCompany(this.$route.query.telephone)
  },
  methods: {
    getCompany (telephone) {
      // let xhr = new XMLHttpRequest();
      // xhr.open("post","/nzcgjsms/api/AppService.ashx");

      // xhr.send({"data":{"allowPaging": true,"business": "GetHdProjects","data": "393498467","pageIndex": 0,"pageSize": 20,"tokenId": "BECC40369A4E48CBD726FED2AE61CDDA","userId": "-1160409415"}});

      // xhr.onreadystatechange = function(){
      //     if(xhr==200){
      //        console.log(xhr.response)
      //     }
      // }
      let param = {
        data: telephone
      }
      companyList(param).then(
         (res) => {
           console.log(res.data[0])
            this.theModel = res.data
         }
      )
    }
  }

}
</script>

<style scoped lang="less">

</style>
